package com.example.myapp.entity;

public class UserInfo {
    private String username;
    private String password;
    private static UserInfo sUserInfo;


    public UserInfo(String username, String password) {
        this.username = username;
        this.password = password;
    }

    // 获取单例实例
    public static synchronized UserInfo getUserInfo() {
        if (sUserInfo == null) {
            // 这里可以初始化默认值
            sUserInfo = new UserInfo("", "");
        }
        return sUserInfo;
    }

    // 设置单例实例
    public static synchronized void setUserInfo(UserInfo userInfo) {
        sUserInfo = userInfo;
    }


    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
